﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;

namespace WsusWebAdmin.Web.Helpers
{
    
    public static class ICollectionExtensions
    {
        public static IEnumerable<T> AsEnumerable<T>(this ICollection collection)
        {
            foreach (var item in collection)
            {
                yield return (T)item;
            }
        }

        public static IEnumerable<T> AsEnumerable<T>(this ICollection collection, Func<object,T> convert)
        {
            foreach (var item in collection)
            {
                yield return convert(item);
            }
        }
    }
}